﻿@model YHWE.Web.Models.document

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>创建 document</legend>

        <div class="editor-label">
            类别
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(d => d.documentTypeID, new SelectList(ViewBag.type, "Key", "Value"))
            @Html.ValidationMessageFor(model => model.documentTypeID)
        </div>

        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
            标题
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.title)
            @Html.ValidationMessageFor(model => model.title)
        </div>



        <div class="editor-label">
            内容
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.content, new { @Style = "width:800px; height:350px" })
            @Html.ValidationMessageFor(model => model.content)
        </div>

        <div class="editor-label">
            有效
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.able)
            @Html.ValidationMessageFor(model => model.able)
        </div>

        <div class="editor-label">
            时间
        </div>
        <div class="editor-field">
            @Html.TextBox("datetime",DateTime.Now.ToShortDateString())
            @Html.ValidationMessageFor(model => model.datetime )
        </div>

        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("回列表", "Index")
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('#content').xheditor({
            skin: 'nostyle',
            tools: "mytools",
            upBtnText: '上传',
            upLinkUrl: '/upload/file/document',
            upImgUrl: '/upload/file/document',
            upFlashUrl: '/upload/file/document',
            upMediaUrl: '/upload/file/document'
        });

    })


    $("#datetime").attr("readonly", "true").datepicker();
</script>